#include<bits/stdc++.h>

using namespace std;
const int maxn = 1e6 + 10;
bool prime[maxn];
int n;

void init() {
    for (int i = 1; i <= n; i++) {
        prime[i] = 1;
    }
    prime[1] = 0;
    for (int i = 2; i * i <= n; i++) {
        if (prime[i]) {
            for (int j = 2 * i; j <= n; j += i) {
                prime[j] = 0;
            }
        }
    }
}

int main() {
    cin >> n;
    init();
    int tot = 0;
    if (n >= 3)++tot;//(2,3);
    for (int p = 3; p + 2 <= n; p += 2) {
        if (prime[p] && prime[p + 2])
            ++tot;
    }
    cout << tot;

    return 0;
}